home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / wil4c10.zip / WIL4C_R.TXT < prev    next >
Text File  |  1997-07-26  |  51KB  |  1,862 lines

  1.  
  2.  
  3.  
  4.  
  5.                      Winsock Interface Communications
  6.  
  7.                            Library for C/C++
  8.  
  9.                                  (WIL4C)
  10.  
  11.  
  12.                             REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.                                 Version 1.0
  17.  
  18.                                 July 28, 1997
  19.  
  20.  
  21.  
  22.  
  23.                      This software is provided as-is.
  24.               There are no warranties, expressed or implied.
  25.  
  26.  
  27.  
  28.  
  29.                          Copyright (C) 1997
  30.                            All rights reserved
  31.  
  32.  
  33.  
  34.                        MarshallSoft Computing, Inc.
  35.                            Post Office Box 4543
  36.                            Huntsville AL 35815
  37.  
  38.                            Voice : 205-881-4630
  39.                              FAX : 205|880|0925
  40.                              BBS : 205-880-9748
  41.                            email : info@marshallsoft.com
  42.                              web : www.marshallsoft.com
  43.  
  44.                                _______
  45.                           ____|__     |                (R)
  46.                        --+       |    +-------------------
  47.                          |   ____|__  |  Association of
  48.                          |  |       |_|  Shareware
  49.                          |__|   o   |    Professionals
  50.                        --+--+   |   +---------------------
  51.                             |___|___|    MEMBER
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.      WIL4C Reference Manual                                    Page 1
  61.  
  62.                             C O N T E N T S
  63.  
  64.  
  65.  
  66.         Chapter                                     Page
  67.  
  68.         Table of Contents.............................2
  69.  
  70.         WIL Functions.................................4
  71.  
  72.            wilAccept..................................4
  73.            wilAskHostByAddr...........................4
  74.            wilAskHostByName...........................5
  75.            wilAskProtoByName..........................5
  76.            wilAskProtoByNumber........................6
  77.            wilAskServByName...........................6
  78.            wilAskServByPort...........................7
  79.            wilAttach..................................7
  80.            wilAwaitEvent..............................8
  81.            wilBind....................................8
  82.            wilCancelBlocking..........................9
  83.            wilCloseSocket.............................9
  84.            wilConnect.................................10
  85.            wilDataIsReady.............................10
  86.            wilDebug...................................11
  87.            wilErrorText...............................11
  88.            wilGetDescription..........................12
  89.            wilGetHostAddr.............................12
  90.            wilGetHostAlias............................13
  91.            wilGetHostDotted...........................13
  92.            wilGetHostName.............................14
  93.            wilGetMaxSockets...........................14
  94.            wilGetMyHostAddr...........................15
  95.            wilGetMyHostDotted.........................15
  96.            wilGetMyHostName...........................16
  97.            wilGetProtoName............................16
  98.            wilGetProtoNumber..........................17
  99.            wilGetServName.............................17
  100.            wilGetServPort.............................18
  101.            wilGetSystemInfo...........................18
  102.            wilGetVendorInfo...........................19
  103.            wilIsBlocking..............................19
  104.            wilIsConnected.............................20
  105.            wilIsDotted................................20
  106.            wilListen..................................21
  107.            wilLocalSockAddr...........................21
  108.            wilLocalSockPort...........................22
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      WIL4C Reference Manual                                    Page 2
  121.  
  122.                           C O N T E N T S
  123.  
  124.                              (continued)
  125.  
  126.  
  127.  
  128.         Chapter                                     Page
  129.  
  130.            wilParseDecimal............................22
  131.            wilPeekSocket..............................23
  132.            wilReadLine................................23
  133.            wilReadOOB.................................24
  134.            wilReadSocket..............................24
  135.            wilReadString..............................25
  136.            wilRelease.................................25
  137.            wilRemoteSockAddr..........................26
  138.            wilRemoteSockPort..........................26
  139.            wilSetOOB..................................27
  140.            wilSocketStatus............................27
  141.            wilTcpSocket...............................28
  142.            wilWaitLine................................28
  143.            wilWriteLine...............................29
  144.            wilWriteOOB................................29
  145.            wilWriteSocket.............................30
  146.            wilWriteString.............................30
  147.  
  148.  
  149.         WIL Error Codes...............................31
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      WIL4C Reference Manual                                    Page 3
  181.  
  182.       +-------------+-----------------------------------------------------+
  183.       |  wilAccept  |  Accepts incoming connection.                       |
  184.       +-------------+-----------------------------------------------------+
  185.  
  186.  
  187.       SYNTAX SOCKET wilAccept(SOCKET Socket, LONG Timeout)
  188.              // Socket  : Winsock socket number.
  189.              // Timeout : Timeout in milliseconds.
  190.  
  191.       REMARK The wilAccept function accepts an incoming connection on a
  192.              specified socket, dequeueing the first connection request
  193.              on the listening socket, and returns a new socket which may be
  194.              used immediately to send or receive data.
  195.  
  196.              wilBind and wilListen are called before wilAccept.
  197.  
  198.       RETURN >0 : Socket.
  199.              < 0 : Error. See error list.
  200.  
  201.        OTHER See wilBind and wilListen.
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.       +------------------+------------------------------------------------+
  212.       | wilAskHostByAddr | Request host information from server.          |
  213.       +------------------+------------------------------------------------+
  214.  
  215.  
  216.       SYNTAX int wilAskHostByAddr(LPSTR Name)
  217.              // Name : Host name in dotted notation format.
  218.  
  219.       REMARK The wilAskHostByAddr function requests host information. After
  220.              this call returns, the wilGetHostAddr and wilGetHostName
  221.              functions can be called to get the actual host information.
  222.  
  223.       RETURN WIL_NO_ERROR : No error.
  224.              < 0 : Error. See error list.
  225.  
  226.        OTHER See wilGetHostAddr and wilGetHostName.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.      WIL4C Reference Manual                                    Page 4
  241.  
  242.       +------------------+------------------------------------------------+
  243.       | wilAskHostByName | Request host information from server.          |
  244.       +------------------+------------------------------------------------+
  245.  
  246.  
  247.       SYNTAX int wilAskHostByName(LPSTR Name)
  248.              // Name : Host name.
  249.  
  250.       REMARK The wilAskHostByName function requests host information.
  251.              After this call returns, the wilGetHostAddr and wilGetHostName
  252.              functions can be called to get the actual host information.
  253.  
  254.       RETURN WIL_NO_ERROR : No error.
  255.              < 0 : Error. See error list.
  256.  
  257.        OTHER See wilGetHostAddr and wilGetHostName.
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.       +-------------------+-----------------------------------------------+
  267.       | wilAskProtoByName | Request protocol information.                 |
  268.       +-------------------+-----------------------------------------------+
  269.  
  270.  
  271.       SYNTAX int wilAskProtoByName(LPSTR Name)
  272.              // Name : Protocol name.
  273.  
  274.       REMARK The wilGetProtoByName function requests protocol information.
  275.              After this call returns, the wilGetProtoName or
  276.              wilGetProtoNumber functions can be called to get the actual
  277.              information.
  278.  
  279.       RETURN WIL_NO_ERROR : No error.
  280.              < 0 : Error. See error list.
  281.  
  282.        OTHER See wilGetProtoName and wilGetProtoNumber.
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.      WIL4C Reference Manual                                    Page 5
  301.  
  302.       +---------------------+---------------------------------------------+
  303.       | wilAskProtoByNumber | Request protocol information.               |
  304.       +---------------------+---------------------------------------------+
  305.  
  306.  
  307.       SYNTAX int wilAskProtoByNumber(int Number)
  308.              // Number : Protocol number.
  309.  
  310.       REMARK The wilAskProtoByNumber function requests protocol
  311.              information. After this call returns, the wilGetProtoName or
  312.              wilGetProtoNumber functions can be called to get the actual
  313.              information.
  314.  
  315.       RETURN WIL_NO_ERROR : No error.
  316.              < 0 : Error. See error list.
  317.  
  318.        OTHER See wilGetProtoName and wilGetProtoNumber.
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.       +------------------+------------------------------------------------+
  327.       | wilAskServByName | Request server information.                    |
  328.       +------------------+------------------------------------------------+
  329.  
  330.  
  331.       SYNTAX int wilAskServByName(LPSTR Name, LPSTR ProtoName)
  332.              // Name      : Host name.
  333.              // ProtoName : Protocol name.
  334.  
  335.       REMARK The wilAskServByName function requests server information.
  336.              After this call returns, the wilGetServName or wilGetServPort
  337.              functions can be called to get the actual information.
  338.  
  339.       RETURN WIL_NO_ERROR : No error.
  340.              < 0 : Error. See error list.
  341.  
  342.        OTHER See wilGetServName and wilGetServPort.
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      WIL4C Reference Manual                                    Page 6
  361.  
  362.       +------------------+------------------------------------------------+
  363.       | wilAskServByPort | Request server information.                    |
  364.       +------------------+------------------------------------------------+
  365.  
  366.  
  367.       SYNTAX int wilAskServByPort(int Number, LPSTR ProtoName)
  368.              // Number    : Port number
  369.              // ProtoName : Protocol name.
  370.  
  371.       REMARK The wilAskServByPort function requests server information.
  372.              After this call returns, the wilGetServName or wilGetServPort
  373.              functions can be called to get the actual information.
  374.  
  375.  
  376.       RETURN WIL_NO_ERROR : No error.
  377.              < 0 : Error. See error list.
  378.  
  379.        OTHER See wilGetServName and wilGetServPort.
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.       +-------------+-----------------------------------------------------+
  387.       |  wilAttach  |  Attaches (initializes) winsock.                    |
  388.       +-------------+-----------------------------------------------------+
  389.  
  390.  
  391.       SYNTAX int wilAttach(void)
  392.  
  393.       REMARK The wilAttach function prepares the WIL system for processing.
  394.              This should be the first WIL function called.
  395.  
  396.       RETURN WIL_NO_ERROR : No error.
  397.              < 0 : Error. See error list.
  398.  
  399.        OTHER See wilRelease.
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.      WIL4C Reference Manual                                    Page 7
  421.  
  422.       +----------------+--------------------------------------------------+
  423.       |  wilAwaitEvent | Set asynchronous event winsock mask.             |
  424.       +----------------+--------------------------------------------------+
  425.  
  426.       SYNTAX int wilAwaitEvent(SOCKET Socket, HWND hWnd, WORD Message,
  427.                                  ULONG EventMask)
  428.              // Socket    : Winsock socket number.
  429.              // hWnd      : Window handle for message posting.
  430.              // Message   : Message number.
  431.              // EventMask : Event Mask.
  432.  
  433.       REMARK The wilAwaitEvent function enables asynchronous processing by
  434.              enabling the events specified by the EventMask. Event mask
  435.              values are defined in WINSOCK.H as
  436.  
  437.              FD_ACCEPT  Sends message when socket has incoming connection.
  438.              FD_CLOSE   Sends message when socket has been closed.
  439.              FD_CONNECT Sends message when socket has completed connecting.
  440.              FD_OOB     Sends message when out-of-band data can be read.
  441.              FD_READ    Sends message when data is available to read.
  442.              FD_WRITE   Sends message when socket is ready for writing.
  443.  
  444.              When the specified event occurs, the specified message is
  445.              posted to the specified window.
  446.  
  447.              Several macros are defined for calling wilAwaitEvent. Refer to
  448.              wilAwaitConnect, wilAwaitAccept, wilAwaitRead, wilAwaitRead,
  449.              wilAwaitWrite, wilAwaitClose, and wilAwaitCancel (in WIL.H).
  450.  
  451.       RETURN WIL_NO_ERROR : No error.
  452.              < 0 : Error. See error list.
  453.  
  454.        OTHER See wilListen and wilAccept.
  455.  
  456.  
  457.  
  458.       +-------------+-----------------------------------------------------+
  459.       |  wilBind    | Bind socket to specified address & port nunber.     |
  460.       +-------------+-----------------------------------------------------+
  461.  
  462.  
  463.       SYNTAX int wilBind(SOCKET Socket, ULONG LocalAddr, short LocalPort)
  464.              // Socket    : Winsock socket number.
  465.              // LocalAddr : Local socket address.
  466.              // LocalPort : Local port number.
  467.  
  468.       REMARK The wilBind function binds a socket address and a port number
  469.              to a particular socket. The bind function specifies the local
  470.              interface address and port number for the specified socket.
  471.  
  472.       RETURN WIL_NO_ERROR : No error.
  473.              < 0 : Error. See error list.
  474.  
  475.        OTHER See wilListen and wilAccept. Also FTP.C example program.
  476.  
  477.  
  478.  
  479.  
  480.      WIL4C Reference Manual                                    Page 8
  481.  
  482.       +-------------------+-----------------------------------------------+
  483.       | wilCancelBlocking | Cancels blocking call.                        |
  484.       +-------------------+-----------------------------------------------+
  485.  
  486.  
  487.       SYNTAX int wilCancelBlocking(void)
  488.  
  489.       REMARK The wilCancelBlocking function cancels any blocking call in
  490.              progress.
  491.  
  492.       RETURN WIL_NO_ERROR : No error.
  493.              < 0 : Error. See error list.
  494.  
  495.        OTHER See wilIsBlocking.
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.       +----------------+--------------------------------------------------+
  503.       | wilCloseSocket | Close socket.                                    |
  504.       +----------------+--------------------------------------------------+
  505.  
  506.  
  507.       SYNTAX int wilCloseSocket(SOCKET Socket)
  508.              // Socket : Winsock socket number.
  509.  
  510.       REMARK The wilCloseSocket function closes a socket. After closing,
  511.              I/O can no longer be performed on the socket.
  512.  
  513.       RETURN WIL_NO_ERROR : No error.
  514.              < 0 : Error. See error list.
  515.  
  516.        OTHER See wilTcpSocket.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.      WIL4C Reference Manual                                    Page 9
  541.  
  542.       +------------+------------------------------------------------------+
  543.       | wilConnect | Initiate coonection to remote port.                  |
  544.       +------------+------------------------------------------------------+
  545.  
  546.  
  547.       SYNTAX int wilConnect(SOCKET Socket, ULONG RemoteAddr,
  548.                               short RemotePort)
  549.              // Socket : Winsock socket number.
  550.              // RemoteAddr : Remote socket address.
  551.              // RemotePort : Remote port number.
  552.  
  553.       REMARK The wilConnect function requests connection to a remote port.
  554.              The connection does not occur before wilConnect returns.
  555.              Rather, wilIsConnected can be called to determine when the
  556.              connection is completed and ready for I/O.
  557.  
  558.              wilConnect is used in client side programs, but usually not
  559.              in server side programs.
  560.  
  561.       RETURN WIL_NO_ERROR : No error.
  562.              < 0 : Error. See error list.
  563.  
  564.        OTHER See wilIsConnected
  565.  
  566.  
  567.  
  568.  
  569.  
  570.       +----------------+--------------------------------------------------+
  571.       | wilDataIsReady | Is socket readable (data is ready).              |
  572.       +----------------+--------------------------------------------------+
  573.  
  574.  
  575.       SYNTAX int wilDataIsReady(SOCKET Socket, ULONG Timeout)
  576.              // Socket  : Winsock socket number.
  577.              // Timeout : Timeout in milliseconds.
  578.  
  579.       REMARK The wilDataIsReady function returns TRUE if data is ready for
  580.              reading on the specified socket. This function will wait up to
  581.              'Timeout' milliseconds for incoming data before returning
  582.              FALSE.
  583.  
  584.       RETURN TRUE : Incoming data is ready to read.
  585.              FALSE : No incoming data is ready.
  586.  
  587.        OTHER See wilIsConnected.
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.      WIL4C Reference Manual                                    Page 10
  601.  
  602.       +----------+--------------------------------------------------------+
  603.       | wilDebug |  Returns bebug value.                                  |
  604.       +----------+--------------------------------------------------------+
  605.  
  606.  
  607.       SYNTAX int wilDebug(int Parm)
  608.              // Parm : Debug parameter.
  609.  
  610.       REMARK In the shareware version of WIL4C, SioDebug returns the number
  611.              of seconds left before the executable times out.
  612.  
  613.              wilDebug returns 0 in the registered version of WIL4C.
  614.  
  615.       RETURN See above.
  616.  
  617.        OTHER None.
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.       +--------------+----------------------------------------------------+
  625.       | wilErrorText | Get text associated with error code.               |
  626.       +--------------+----------------------------------------------------+
  627.  
  628.  
  629.       SYNTAX int wilErrorText(WORD Code, LPSTR Buffer, int Size)
  630.              // Code   : Error code.
  631.              // Buffer : Buffer for error text.
  632.              // Size   : Size of error text buffer.
  633.  
  634.       REMARK The wilErrorText function retrives the error text associated
  635.              with the passed error code, and returns it in Buffer.
  636.  
  637.       RETURN WIL_NO_ERROR : No error.
  638.              < 0 : Error. See error list.
  639.  
  640.        OTHER None.
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.      WIL4C Reference Manual                                    Page 11
  661.  
  662.       +-------------------+-----------------------------------------------+
  663.       | wilGetDescription | Get winsock description text.                 |
  664.       +-------------------+-----------------------------------------------+
  665.  
  666.  
  667.       SYNTAX LPSTR wilGetDescription(void)
  668.  
  669.       REMARK The wilGetDescription function returns the winsock
  670.              description text after initializing (by calling wilAttach).
  671.  
  672.              The text returned is determined by the implementor of the
  673.              WINSOCK.
  674.  
  675.       RETURN NULL : Text not available.
  676.              Else : Pointer to text.
  677.  
  678.        OTHER See wilGetVendorInfo and wilGetSystemInfo.
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.       +----------------+--------------------------------------------------+
  686.       | wilGetHostAddr | Get host address.                                |
  687.       +----------------+--------------------------------------------------+
  688.  
  689.  
  690.       SYNTAX ULONG wilGetHostAddr(int Index)
  691.              // Index : Host address index.
  692.  
  693.       REMARK The wilGetHostAddr function returns the host address,
  694.              associated with the last call to wilAskHostByName or
  695.              wilAskHostByAddr.
  696.  
  697.              The first (or only) host address corresponds to Index=0.
  698.              Additional host addresses are returning for Index>0. No more
  699.              host addresses are available when 0 is returned.
  700.  
  701.              See HOST.C for an example.
  702.  
  703.       RETURN WIL_NO_ERROR : No error.
  704.              < 0 : Error. See error list.
  705.  
  706.        OTHER See wilAskHostByName and wilAskHostByAddr.
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.      WIL4C Reference Manual                                    Page 12
  721.  
  722.       +-----------------+-------------------------------------------------+
  723.       | wilGetHostAlias | Get host name alias.                            |
  724.       +-----------------+-------------------------------------------------+
  725.  
  726.  
  727.       SYNTAX LPSTR wilGetHostAlias(int Index)
  728.              // Index : Host alias (address) index.
  729.  
  730.       REMARK The wilGetHostAlias function returns the host alias name
  731.              associated with the last call to wilAskHostByName or
  732.              wilAskHostByAddr. The first (if any) name alias corresponds to
  733.              Index=0.  No more host aliases are available when NULL is
  734.              returned.
  735.  
  736.              See HOST.C for an example.
  737.  
  738.       RETURN NULL : Text not available.
  739.              Else : Pointer to text.
  740.  
  741.        OTHER See wilAskHostByName and wilAskHostByAddr.
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.       +------------------+------------------------------------------------+
  749.       | wilGetHostDotted | Get host dotted address.                       |
  750.       +------------------+------------------------------------------------+
  751.  
  752.  
  753.       SYNTAX LPSTR wilGetHostDotted(int Index)
  754.              // Index : Host address index.
  755.  
  756.       REMARK The wilGetHostDotted function returns the host address in
  757.              dotted decimal notation associated with the last call to
  758.              wilAskHostByName or wilAskHostByAddr.
  759.  
  760.              The first (or only) host address corresponds to Index=0.
  761.              Additional host addresses are returning for Index>0. No more
  762.              host addresses are available when 0 is returned.
  763.  
  764.              See HOST.C for an example.
  765.  
  766.       RETURN NULL : Text not available.
  767.              Else : Pointer to text.
  768.  
  769.        OTHER See wilAskHostByName and wilAskHostByAddr.
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.      WIL4C Reference Manual                                    Page 13
  781.  
  782.       +----------------+--------------------------------------------------+
  783.       | wilGetHostName | Get host name.                                   |
  784.       +----------------+--------------------------------------------------+
  785.  
  786.  
  787.       SYNTAX LPSTR wilGetHostName(void)
  788.  
  789.       REMARK The wilGetHostName function returns the host address name
  790.              associated with the last call to wilAskHostByName or
  791.              wilAskHostByAddr.
  792.  
  793.              See HOST.C for an example.
  794.  
  795.       RETURN NULL : Text not available.
  796.              Else : Pointer to text.
  797.  
  798.        OTHER See wilAskHostByName and wilAskHostByAddr.
  799.  
  800.  
  801.  
  802.  
  803.  
  804.       +------------------+------------------------------------------------+
  805.       | wilGetMaxSockets | Get maximum number of sockets supported.       |
  806.       +------------------+------------------------------------------------+
  807.  
  808.  
  809.       SYNTAX int wilGetMaxSockets(void)
  810.  
  811.       REMARK The wilGetMaxSockets functions the maximum number of sockets
  812.              available to the callng application.
  813.  
  814.       RETURN WIL_NO_ERROR : No error.
  815.              < 0 : Error. See error list.
  816.  
  817.        OTHER None.
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.      WIL4C Reference Manual                                    Page 14
  841.  
  842.       +------------------+------------------------------------------------+
  843.       | wilGetMyHostAddr | Get local host address.                        |
  844.       +------------------+------------------------------------------------+
  845.  
  846.  
  847.       SYNTAX ULONG wilGetMyHostAddr(int Index)
  848.              // Index : Local host address index.
  849.  
  850.       REMARK The wilGetMyHostAddr function returns the address of the local
  851.              host (in host byte order). The first (or only) host address
  852.              corresponds to Index=0. No more host addresses are available
  853.              when 0 is returned.
  854.  
  855.       RETURN > 0 : Host address [host byte order].
  856.              < 0 : Error. See error list.
  857.  
  858.        OTHER See wilGetMyHostDotted and wilGetMyHostName.
  859.  
  860.  
  861.  
  862.  
  863.  
  864.       +--------------------+----------------------------------------------+
  865.       | wilGetMyHostDotted | Get local host (dotted) address.             |
  866.       +--------------------+----------------------------------------------+
  867.  
  868.  
  869.       SYNTAX LPSTR wilGetMyHostDotted(int Index)
  870.               // Index : Local host address index.
  871.  
  872.       REMARK The wilGetMyHostDotted function returns the host name of the
  873.              local host in dotted decimal notation. The first (or only)
  874.              host address corresponds to Index=0. No more host addresses
  875.              are available when NULL is returned.
  876.  
  877.       RETURN NULL : Text not available.
  878.              Else : Pointer to text.
  879.  
  880.        OTHER See wilGetMyHostName and wilGetMyHostAddr.
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      WIL4C Reference Manual                                    Page 15
  901.  
  902.       +------------------+------------------------------------------------+
  903.       | wilGetMyHostName | Get local host name.                           |
  904.       +------------------+------------------------------------------------+
  905.  
  906.  
  907.       SYNTAX LPSTR wilGetMyHostName(void)
  908.  
  909.       REMARK The wilGetMyHostName function returns the name of the local
  910.              host.
  911.  
  912.       RETURN NULL : Text not available.
  913.              Else : Pointer to text.
  914.  
  915.        OTHER See wilGetMyHostAddr and wilGetMyHostDotted.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.       +-----------------+-------------------------------------------------+
  922.       | wilGetProtoName | Get protocol name.                              |
  923.       +-----------------+-------------------------------------------------+
  924.  
  925.  
  926.       SYNTAX LPSTR wilGetProtoName(void)
  927.  
  928.       REMARK The wilGetProtoName function returns the protocol name
  929.              associated with the last call to wilAskProtoByName or
  930.              wilAskProtoByNumber.
  931.  
  932.              See HOST.C for an example.
  933.  
  934.       RETURN NULL : Text not available.
  935.              Else : Pointer to text.
  936.  
  937.        OTHER See wilAskProtoByName and wilAskProtoByNumber.
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.      WIL4C Reference Manual                                    Page 16
  961.  
  962.       +-------------------+-----------------------------------------------+
  963.       | wilGetProtoNumber | Get protocol number.                          |
  964.       +-------------------+-----------------------------------------------+
  965.  
  966.  
  967.       SYNTAX short wilGetProtoNumber(void)
  968.  
  969.       REMARK The wilGetProtoNumber function returns the protocol number
  970.              associated with the last call to wilAskProtoByName or
  971.              wilAskProtoByNumber.
  972.  
  973.              See HOST.C for an example.
  974.  
  975.       RETURN > 0 : Protocol number.
  976.              < 0 : Error. See error list.
  977.  
  978.        OTHER See wilAskProtoByName and wilAskProtoByNumber.
  979.  
  980.  
  981.  
  982.  
  983.       +----------------+--------------------------------------------------+
  984.       | wilGetServName | Get server name.                                 |
  985.       +----------------+--------------------------------------------------+
  986.  
  987.  
  988.       SYNTAX LPSTR wilGetServName(void)
  989.  
  990.       REMARK The wilGetServName function return the server name after
  991.              associated with the last call to wilAskServByName or
  992.              wilAskServByPort.
  993.  
  994.              See HOST.C for an example.
  995.  
  996.       RETURN NULL : Text not available.
  997.              Else : Pointer to text.
  998.  
  999.        OTHER See wilAskServByName and wilAskServByPort.
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.      WIL4C Reference Manual                                    Page 17
  1021.  
  1022.       +----------------+--------------------------------------------------+
  1023.       | wilGetServPort | Get server port.                                 |
  1024.       +----------------+--------------------------------------------------+
  1025.  
  1026.  
  1027.       SYNTAX LPSTR wilGetServPort(void) /* get server port [after calling
  1028.  
  1029.  
  1030.       REMARK The wilGetServPort function returns the server port associated
  1031.              with the last call to wilAskServByName or wilAskServByPort.
  1032.  
  1033.              See HOST.C for an example.
  1034.  
  1035.       RETURN > 0 : Server port number.
  1036.              < 0 : Error. See error list.
  1037.  
  1038.        OTHER See wilAskServByName and wilAskServByPort.
  1039.  
  1040.  
  1041.  
  1042.  
  1043.       +------------------+------------------------------------------------+
  1044.       | wilGetSystemInfo | Get winsock system information.                |
  1045.       +------------------+------------------------------------------------+
  1046.  
  1047.  
  1048.       SYNTAX LPSTR wilGetSystemInfo(void)
  1049.  
  1050.       REMARK The wilGetSystemInfo function returns system WINSOCK information.
  1051.  
  1052.              The text returned is determined by the implementor of the
  1053.              WINSOCK.
  1054.  
  1055.       RETURN NULL : Text not available.
  1056.              Else : Pointer to text.
  1057.  
  1058.        OTHER See wilGetVendorInfo and wilGetDescription.
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.      WIL4C Reference Manual                                    Page 18
  1081.  
  1082.       +------------------+------------------------------------------------+
  1083.       | wilGetVendorInfo | Get winsock vendor information.                |
  1084.       +------------------+------------------------------------------------+
  1085.  
  1086.  
  1087.       SYNTAX LPSTR wilGetVendorInfo(void)
  1088.  
  1089.       REMARK The wilGetVendorInfo function returns vendor specific WINSOCK
  1090.              information.
  1091.  
  1092.              The text returned is determined by the implementor of the
  1093.              WINSOCK.
  1094.  
  1095.       RETURN NULL : Text not available.
  1096.              Else : Pointer to text.
  1097.  
  1098.        OTHER See wilGetDescription and wilGetSystemInfo.
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.       +---------------+---------------------------------------------------+
  1107.       | wilIsBlocking | Is winsock currently blocking ?                   |
  1108.       +---------------+---------------------------------------------------+
  1109.  
  1110.  
  1111.       SYNTAX int wilIsBlocking(void)
  1112.  
  1113.       REMARK The wilIsBlocking function returns TRUE or FALSE to indicate
  1114.              if the socket is currently blocking.
  1115.  
  1116.       RETURN TRUE : Socket is currently blocking.
  1117.              FALSE : Socket is not blocking.
  1118.  
  1119.        OTHER See wilCancelBlocking.
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.      WIL4C Reference Manual                                    Page 19
  1141.  
  1142.       +----------------+--------------------------------------------------+
  1143.       | wilIsConnected | Is socket connected to remote ?                  |
  1144.       +----------------+--------------------------------------------------+
  1145.  
  1146.  
  1147.       SYNTAX int wilIsConnected(SOCKET Socket, ULONG Timeout)
  1148.              // Socket   : Winsock socket number.
  1149.              // Timneout : Timeout in millisecs.
  1150.  
  1151.       REMARK The wilIsConnected function returns TRUE or FALSE to indicate
  1152.              if the specified socket is writable, which means that a
  1153.              connection has been completed to a remote host. This function
  1154.              will wait up to 'Timeout' milliseconds for a connection before
  1155.              returning FALSE.
  1156.  
  1157.       RETURN WIL_NO_ERROR : No error.
  1158.              < 0 : Error. See error list.
  1159.  
  1160.        OTHER See wilDataIsReady.
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.       +-------------+-----------------------------------------------------+
  1167.       | wilIsDotted | Is dotted string properly formed ?                  |
  1168.       +-------------+-----------------------------------------------------+
  1169.  
  1170.  
  1171.       SYNTAX int wilIsDotted(LPSTR Name)
  1172.              // Name : Host name in dotted notation.
  1173.  
  1174.       REMARK The wilIsDotted function returns TRUE or FALSE to indicate if
  1175.              the passed text Name is in legal dotted format.
  1176.  
  1177.              A legal dotted name consists of 4 components separated by
  1178.              decimal points each of which is in the ranger of 0 to 255.
  1179.  
  1180.       RETURN TRUE : Name is good dotted address.
  1181.              FALSE : Name has errors.
  1182.  
  1183.        OTHER None.
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.      WIL4C Reference Manual                                    Page 20
  1201.  
  1202.       +-----------+-------------------------------------------------------+
  1203.       | wilListen | Listen for incoming connection attempts.              |
  1204.       +-----------+-------------------------------------------------------+
  1205.  
  1206.  
  1207.       SYNTAX int wilListen(SOCKET Socket, int BackLog)
  1208.              // Socket : Winsock socket number.
  1209.              // BackLog : Number of concurrent sessions.
  1210.  
  1211.       REMARK The wilListen function specifies the socket to be used to
  1212.              listen for incoming connection requests. A call to wilListen
  1213.              is usually preceeded by a call to wilBind.
  1214.  
  1215.              After calling wilListen, incoming connection requests can be
  1216.              accepted by wilAccept.
  1217.  
  1218.       RETURN WIL_NO_ERROR : No error.
  1219.              < 0 : Error. See error list.
  1220.  
  1221.        OTHER See wilBind and wilAccept.
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.       +------------------+------------------------------------------------+
  1228.       | wilLocalSockAddr | Get local sock address for connected socket.   |
  1229.       +------------------+------------------------------------------------+
  1230.  
  1231.  
  1232.       SYNTAX ULONG wilLocalSockAddr(SOCKET Socket)
  1233.              // Socket : Winsock socket number.
  1234.  
  1235.       REMARK The wilLocalSockAddr function returns the local socket address
  1236.              associated with an open socket.
  1237.  
  1238.       RETURN > 0 : Local socket address.
  1239.              < 0 : Error. See error list.
  1240.  
  1241.        OTHER See wilLocalSockPort.
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.      WIL4C Reference Manual                                    Page 21
  1261.  
  1262.       +------------------+------------------------------------------------+
  1263.       | wilLocalSockPort | Get local sock port number for connected sock. |
  1264.       +------------------+------------------------------------------------+
  1265.  
  1266.  
  1267.       SYNTAX short wilLocalSockPort(SOCKET Socket)
  1268.              // Socket : Winsock socket number.
  1269.  
  1270.       REMARK The wilLocalSockPort function returns the local socket port
  1271.              associated with an open socket.
  1272.  
  1273.       RETURN > 0 : Local socket port number.
  1274.              < 0 : Error. See error list.
  1275.  
  1276.        OTHER See wilLocalSockAddr.
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.       +-----------------+-------------------------------------------------+
  1285.       | wilParseDecimal | Parse decimal response code.                    |
  1286.       +-----------------+-------------------------------------------------+
  1287.  
  1288.  
  1289.       SYNTAX ULONG ParseDecimal(LPSTR Buffer)
  1290.              // Buffer : Text buffer to parse.
  1291.  
  1292.       REMARK The wilParseDecimal function parses the text string in Buffer
  1293.              and returns the decimal value. A zero is retuned if the text
  1294.              string does not begin with a decimal digit.
  1295.  
  1296.              The function is used to return the decimal result codes
  1297.              preceeding many protocol response messages, and to return the
  1298.              (unsigned long) article numbers in NTTP.
  1299.  
  1300.       RETURN Unsigned long decimal value.
  1301.  
  1302.        OTHER None.
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.      WIL4C Reference Manual                                    Page 22
  1321.  
  1322.       +---------------+---------------------------------------------------+
  1323.       | wilPeekSocket | Peek into socket.                                 |
  1324.       +---------------+---------------------------------------------------+
  1325.  
  1326.  
  1327.       SYNTAX int wilPeekSocket(SOCKET Socket, LPSTR Buffer, int BufSize)
  1328.              // Socket  : Winsock socket number.
  1329.              // Buffer  : Data buffer.
  1330.              // BufSize : Size of data buffer.
  1331.  
  1332.       REMARK The wilPeekSocket function performs a non-destructive read or
  1333.              "look ahead".
  1334.  
  1335.       RETURN = 0 : Data not available.
  1336.              > 0 : Number of bytes actually read.
  1337.              < 0 : Error. See error list.
  1338.  
  1339.        OTHER See wilReadSocket.
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.       +-------------+-----------------------------------------------------+
  1346.       | wilReadLine | Read line terminated with linefeed.                 |
  1347.       +-------------+-----------------------------------------------------+
  1348.  
  1349.  
  1350.       SYNTAX int wilReadLine(SOCKET Socket, LPSTR Buffer, int BufSize)
  1351.              // Socket  : Winsock socket number.
  1352.              // Buffer  : Data buffer.
  1353.              // BufSize : Size of data buffer.
  1354.  
  1355.       REMARK The wilReadLine function reads the requested number of bytes
  1356.              or until a linefeed ('\n') character is read.
  1357.  
  1358.              Upon return, the last character of Buffer can be examined to
  1359.              see if an entire line was read. Do not assume that an entire
  1360.              line was read without checking that the last character is a
  1361.              linefeed ('\n').
  1362.  
  1363.       RETURN = 0 : Data not available.
  1364.              > 0 : Number of bytes actually read.
  1365.              < 0 : Error. See error list.
  1366.  
  1367.        OTHER See wilReadSocket and wilReadString.
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.      WIL4C Reference Manual                                    Page 23
  1381.  
  1382.       +------------+---------+--+-----------------------------------------+
  1383.       | wilReadOOB | Read Out|Of|Bound data.                              |
  1384.       +------------+---------+--+-----------------------------------------+
  1385.  
  1386.  
  1387.       SYNTAX int wilReadOOB(SOCKET Socket, LPSTR Buffer, int BufSize)
  1388.              // Socket  : Winsock socket number.
  1389.              // Buffer  : Data buffer.
  1390.              // BufSize : Size of data buffer.
  1391.  
  1392.       REMARK The wilReadOOB function reads the specified number of
  1393.              Out-Of-Bounds (OOB) bytes for the socket. The function will
  1394.              return 0 if no bytes are currently available. Note that fewer
  1395.              bytes may be read than requested.
  1396.  
  1397.              Reading of OOB data must be enabled (wilSetOOB) before calling
  1398.              this function.
  1399.  
  1400.       RETURN = 0 : Data not available.
  1401.              > 0 : Number of bytes actually read.
  1402.              < 0 : Error. See error list.
  1403.  
  1404.        OTHER See wilReadSocket and wilReadString.
  1405.  
  1406.  
  1407.  
  1408.  
  1409.       +---------------+---------------------------------------------------+
  1410.       | wilReadSocket | Read from socket.                                 |
  1411.       +---------------+---------------------------------------------------+
  1412.  
  1413.  
  1414.       SYNTAX int wilReadSocket(SOCKET Socket, LPSTR Buffer, int BufSize)
  1415.              // Socket  : Winsock socket number.
  1416.              // Buffer  : Data buffer.
  1417.              // BufSize : Size of data buffer.
  1418.  
  1419.       REMARK The wilReadSocket function reads the specified number of bytes
  1420.              for the socket. The function will return 0 if no bytes are
  1421.              currently available. Note that fewer bytes may be read than
  1422.              requested.
  1423.  
  1424.       RETURN = 0 : Data not available.
  1425.              > 0 : Number of bytes actually read.
  1426.              < 0 : Error. See error list.
  1427.  
  1428.        OTHER See wilReadLine and wilReadString.
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.      WIL4C Reference Manual                                    Page 24
  1441.  
  1442.       +---------------+---------------------------------------------------+
  1443.       | wilReadString | Read string from socket.                          |
  1444.       +---------------+---------------------------------------------------+
  1445.  
  1446.  
  1447.       SYNTAX int wilReadString(SOCKET Socket, LPSTR Buffer, int BufSize)
  1448.              // Socket  : Winsock socket number.
  1449.              // Buffer  : Data buffer.
  1450.              // BufSize : Size of data buffer.
  1451.  
  1452.       REMARK The wilReadString function performs a wilReadSocket, then
  1453.              appends the NUL character '\0'.
  1454.  
  1455.       RETURN = 0 : Data not available.
  1456.              > 0 : Number of bytes actually read.
  1457.              < 0 : Error. See error list.
  1458.  
  1459.        OTHER See wilReadSocket and wilReadLine.
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.       +------------+------------------------------------------------------+
  1466.       | wilRelease | Release (free) winsock.                              |
  1467.       +------------+------------------------------------------------------+
  1468.  
  1469.  
  1470.       SYNTAX int wilRelease(void)
  1471.  
  1472.       REMARK The wilRelease function releases the WINSOCK resources, after
  1473.              which socket functions should not be called.
  1474.  
  1475.              wilRelease should be called before exiting the application
  1476.              program.
  1477.  
  1478.       RETURN WIL_NO_ERROR : No error.
  1479.              < 0 : Error. See error list.
  1480.  
  1481.        OTHER See wilAttach.
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.      WIL4C Reference Manual                                    Page 25
  1501.  
  1502.       +-------------------+-----------------------------------------------+
  1503.       | wilRemoteSockAddr | Get remote sock address for connected socket. |
  1504.       +-------------------+-----------------------------------------------+
  1505.  
  1506.  
  1507.       SYNTAX ULONG wilRemoteSockAddr(SOCKET Socket)
  1508.              // Socket : Winsock socket number.
  1509.  
  1510.       REMARK The wilRemoteSockAddr function returns the address of the
  1511.              connected remote socket.
  1512.  
  1513.       RETURN Remote socket address [host byte order].
  1514.              = 0 : Address not available.
  1515.  
  1516.        OTHER See wilRemoteSockAddr.
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.       +-------------------+-----------------------------------------------+
  1526.       | wilRemoteSockPort | Get remote port number for connected socket.  |
  1527.       +-------------------+-----------------------------------------------+
  1528.  
  1529.  
  1530.       SYNTAX short wilRemoteSockPort(SOCKET Socket)
  1531.              // Socket : Winsock socket number.
  1532.  
  1533.       REMARK The wilRemoteSockPort function returns the port number of the
  1534.              cvonnected remote host.
  1535.  
  1536.       RETURN Port number of remote socket.
  1537.              = 0 : Port not available.
  1538.  
  1539.        OTHER See wilRemoteSockAddr.
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.      WIL4C Reference Manual                                    Page 26
  1561.  
  1562.       +-----------+---------+--+------------------------------------------+
  1563.       | wilSetOOB | Sets Out|Of|Bound (OOB) data state.                   |
  1564.       +-----------+---------+--+------------------------------------------+
  1565.  
  1566.  
  1567.       SYNTAX int wilSetOOB(SOCKET Socket, int StateFlag)
  1568.              // Socket : Winsock socket number.
  1569.              // StateFlag : Enable OOB if TRUE.
  1570.  
  1571.       REMARK The wilSetOOB function enables or disable Out-Of-Bound (OOB)
  1572.              data depending on the value StateFlag.
  1573.  
  1574.              OOB data is data that is processed ahead of any other data
  1575.              that is not OOB. Typically, OOB data is used to indicate an
  1576.              error condition of some sort.
  1577.  
  1578.              When OOB is enabled, only OOB data can be read.
  1579.  
  1580.       RETURN WIL_NO_ERROR : No error.
  1581.              < 0 : Error. See error list.
  1582.  
  1583.        OTHER See wilReadOOB and wilWriteOOB.
  1584.  
  1585.  
  1586.  
  1587.  
  1588.       +-----------------+-------------------------------------------------+
  1589.       | wilSocketStatus | Get socket read/write status.                   |
  1590.       +-----------------+-------------------------------------------------+
  1591.  
  1592.  
  1593.       SYNTAX int wilSocketStatus(SOCKET Socket, int StatusFlag)
  1594.              // Socket : Winsock socket number.
  1595.              // StatusFlag : Status type requested (see below).
  1596.  
  1597.       REMARK The wilSocketStatus function returns the socket status
  1598.              requested as follows:
  1599.  
  1600.              StatusFlag         Description
  1601.              WIL_READ_STATUS    Returns TRUE if socket has incoming data.
  1602.              WIL_WRITE_STATUS   Returns TRUE if socket is writtable.
  1603.              WIL_ERROR_STATUS   Returns TRUE if socket has error.
  1604.  
  1605.              A socket is connected if it is writtable.
  1606.  
  1607.       RETURN WIL_NO_ERROR : No error.
  1608.              < 0 : Error. See error list.
  1609.  
  1610.        OTHER See wilDataIsReady and wilIsConnected.
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.      WIL4C Reference Manual                                    Page 27
  1621.  
  1622.       +--------------+----------------------------------------------------+
  1623.       | wilTcpSocket | Create TCP socket.                                 |
  1624.       +--------------+----------------------------------------------------+
  1625.  
  1626.  
  1627.       SYNTAX SOCKET wilTcpSocket(void)
  1628.  
  1629.       REMARK The wilTcpSocket function creates a TCP socket. wilTcpSocket
  1630.              must be called before calling wilBind or wilConnect.
  1631.  
  1632.       RETURN > 0 : TCP socket.
  1633.              < 0 : Error. See error list.
  1634.  
  1635.        OTHER See wilCloseSocket.
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.       +-------------+-----------------------------------------------------+
  1642.       | wilWaitLine | Read line, waiting for terminating linefeed.        |
  1643.       +-------------+-----------------------------------------------------+
  1644.  
  1645.       SYNTAX int wilWaitLine(SOCKET Socket,  LPSTR Buffer,
  1646.                                int    BufSize, ULONG Timeout)
  1647.              // Socket  : Winsock socket number.
  1648.              // Buffer  : Data buffer.
  1649.              // BufSize : Size of data buffer.
  1650.  
  1651.       REMARK The wilWaitLine function reads the requested number of bytes
  1652.              or until a linefeed ('\n') character is read.
  1653.  
  1654.              The wilWaitLine function will wait up to a maximum of 'Timeout'
  1655.              milliseconds for a terminating linefeed ('\n') character.
  1656.              Examine the last byte of 'Buffer' to determine if the linefeed
  1657.              was actually read.
  1658.  
  1659.       RETURN = 0 : Data not available.
  1660.              > 0 : Number of bytes actually read.
  1661.              < 0 : Error. See error list.
  1662.  
  1663.        OTHER See wilReadLine.
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.      WIL4C Reference Manual                                    Page 28
  1681.  
  1682.       +--------------+----------------------------------------------------+
  1683.       | wilWriteLine | Write linefeed terminated line to socket.          |
  1684.       +--------------+----------------------------------------------------+
  1685.  
  1686.  
  1687.       SYNTAX int wilWriteLine(SOCKET Socket, LPSTR String)
  1688.              // Socket  : Winsock socket number.
  1689.              // String  : String buffer.
  1690.  
  1691.       REMARK The wilWriteLine function performs wilWriteString, then
  1692.              writes carriage return ('\r') and linefeed ('\n') to the
  1693.              socket.
  1694.  
  1695.       RETURN = 0 : Could not write.
  1696.              > 0 : Number of bytes actually written.
  1697.              < 0 : Error. See error list.
  1698.  
  1699.        OTHER See wilWriteSocket and wilWriteString.
  1700.  
  1701.  
  1702.  
  1703.  
  1704.       +-------------+----------+--+---------------------------------------+
  1705.       | wilWriteOOB | Write Out|Of|Bounds (OOB) data to socket.           |
  1706.       +-------------+----------+--+---------------------------------------+
  1707.  
  1708.  
  1709.       SYNTAX int wilWriteOOB(SOCKET Socket, LPSTR Buffer, int BufSize)
  1710.              // Socket : Winsock socket number.
  1711.              // Buffer  : Data buffer.
  1712.              // BufSize : Size of data buffer.
  1713.  
  1714.       REMARK The wilWriteOOB function attempts to write the requested
  1715.              bytes in Buffer to the secified socket.
  1716.  
  1717.       RETURN = 0 : Could not write.
  1718.              > 0 : Number of bytes actually written.
  1719.              < 0 : Error. See error list.
  1720.  
  1721.        OTHER
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.      WIL4C Reference Manual                                    Page 29
  1741.  
  1742.       +----------------+--------------------------------------------------+
  1743.       | wilWriteSocket | Write buffer to socket.                          |
  1744.       +----------------+--------------------------------------------------+
  1745.  
  1746.  
  1747.       SYNTAX int wilWriteSocket(SOCKET Socket, LPSTR Buffer, int BufSize)
  1748.              // Socket : Winsock socket number.
  1749.              // Buffer : Data buffer.
  1750.              // BufSize : Size of data buffer.
  1751.  
  1752.       REMARK The wilWriteSocket function attempts to write the requested
  1753.              number of byte to the specified socket.
  1754.  
  1755.              Note that fewer bytes may be written than requested.
  1756.  
  1757.       RETURN = 0 : Could not write.
  1758.              > 0 : Number of bytes actually written.
  1759.              < 0 : Error. See error list.
  1760.  
  1761.        OTHER
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.       +----------------+--------------------------------------------------+
  1770.       | wilWriteString | Write string to socket.                          |
  1771.       +----------------+--------------------------------------------------+
  1772.  
  1773.  
  1774.       SYNTAX int wilWriteString(SOCKET Socket, LPSTR String)
  1775.              // Socket  : Winsock socket number.
  1776.              // String  : String buffer (terminated with '\0').
  1777.  
  1778.       REMARK The wilWriteString function performs wilWriteSocket, using the
  1779.              string length of String for the requested bytes to write.
  1780.  
  1781.       RETURN = 0 : Could not write.
  1782.              > 0 : Number of bytes actually written.
  1783.              < 0 : Error. See error list.
  1784.  
  1785.        OTHER
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.      WIL4C Reference Manual                                    Page 30
  1801.  
  1802.  
  1803.                           WIL Error Codes
  1804.  
  1805.  
  1806.       +---------------------+-------------------------------------------+
  1807.       | WIL_NO_ERROR        | No error.                                 |
  1808.       | WIL_CANNOT_COMPLY   | Cannot comply. Not neccessarily an error. |
  1809.       +---------------------+-------------------------------------------+
  1810.       | WIL_EOF             | End of file (socket has been closed).     |
  1811.       | WIL_IS_BLOCKING     | Socket is currently blocking.             |
  1812.       | WIL_BAD_STATUS_FLAG | Bad status flag passed to wilSocketStatus.|
  1813.       | WIL_BAD_DOTTED      | Bad dotted address.                       |
  1814.       | WIL_INVALID_SOCKET  | Invalid socket nunber.                    |
  1815.       | WIL_TIMED_OUT       | Socket timed out awaiting data.           |
  1816.       | WIL_NO_SOCK_ADDR    | Socket address pool exhausted.            |
  1817.       | WIL_NO_PROTOCOL     | AskProtoBy* not previously called.        |
  1818.       | WIL_NO_SERVICE      | AskServBy* not previously called.         |
  1819.       | WIL_NO_HOST         | Error returning host information.         |
  1820.       | WIL_EXPIRED         | The shareware version has expired.        |
  1821.       | WIL_ABORTED         | The shareware DLL has been corrupted.     |
  1822.       +---------------------+-------------------------------------------+
  1823.  
  1824.  
  1825.       WIL_EXPIRED can be returned only when using the shareware version.
  1826.       The shareware version will "time out" after 20 minutes, limiting
  1827.       execution to a maximum of twenty minutes EACH time a program is run.
  1828.       An expired program can always be restarted. The wilDebug function can
  1829.       be called to return the number of seconds left before expiration.
  1830.  
  1831.       WIL_ABORTED will be returned if the DLL has been modified. You should
  1832.       never get this message!
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.      WIL4C Reference Manual                                    Page 31
  1861.  
  1862.